home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / other / python-1.52 / source / include / mymath.h < prev    next >
C/C++ Source or Header  |  1999-06-14  |  2KB  |  92 lines

  1. /* On the 68K Mac, when using CFM (Code Fragment Manager),
  2.    <math.h> requires special treatment -- we need to surround it with
  3.    #pragma lib_export off / on...
  4.    This is because MathLib.o is a static library, and exporting its
  5.    symbols doesn't quite work...
  6.    XXX Not sure now...  Seems to be something else going on as well... */
  7.  
  8. #ifdef SYMANTEC__CFM68K__
  9. #pragma lib_export off
  10. #endif
  11.  
  12. #ifndef HAVE_HYPOT
  13. #include "myproto.h"
  14. extern double hypot Py_PROTO((double, double));
  15. #ifdef MWERKS_BEFORE_PRO4
  16. #define hypot we_dont_want_faulty_hypot_decl
  17. #endif
  18. #endif
  19.  
  20. #include <math.h>
  21.  
  22. #ifndef HAVE_HYPOT
  23. #ifdef __MWERKS__
  24. #undef hypot
  25. #endif
  26. #endif
  27.  
  28. #ifdef SYMANTEC__CFM68K__
  29. #pragma lib_export on
  30. #endif
  31.  
  32. #if defined(USE_MSL) && defined(__MC68K__)
  33. /* CodeWarrior MSL 2.1.1 has weird define overrides that don't work
  34. ** when you take the address of math functions. If I interpret the
  35. ** ANSI C standard correctly this is illegal, but I haven't been able
  36. ** to convince the MetroWerks folks of this...
  37. */
  38. #undef acos
  39. #undef asin
  40. #undef atan
  41. #undef atan2
  42. #undef ceil
  43. #undef cos
  44. #undef cosh
  45. #undef exp
  46. #undef fabs
  47. #undef floor
  48. #undef fmod
  49. #undef log
  50. #undef log10
  51. #undef pow
  52. #undef sin
  53. #undef sinh
  54. #undef sqrt
  55. #undef tan
  56. #undef tanh
  57. #define acos acosd
  58. #define asin asind
  59. #define atan atand
  60. #define atan2 atan2d
  61. #define ceil ceild
  62. #define cos cosd
  63. #define cosh coshd
  64. #define exp expd
  65. #define fabs fabsd
  66. #define floor floord
  67. #define fmod fmodd
  68. #define log logd
  69. #define log10 log10d
  70. #define pow powd
  71. #define sin sind
  72. #define sinh sinhd
  73. #define sqrt sqrtd
  74. #define tan tand
  75. #define tanh tanhd
  76. #endif 
  77.  
  78.  
  79. /* Include proper Amiga SAS/C math include files */
  80.  
  81. #ifdef __SASC
  82. #if defined(_IEEE) && !defined(_M68881)
  83. #include <mieeedoub.h>
  84. #endif
  85. #ifdef _FFP
  86. #include <mffp.h>
  87. #endif
  88. #ifdef _M68881
  89. #include <m68881.h>
  90. #endif
  91. #endif
  92.